package com.neuedu.exception;

public class FunctionInvoke {


    public void m1(){
        //局部变量
        int numa = 100;
        System.out.println("FunctionInvoke.m1");
        //调用m2
        this.m2();
    }

    public void m2(){
        int numa = 200;
        System.out.println("FunctionInvoke.m2");
        //调用m3
        this.m3();
    }


    public void m3(){
        int numa = 300;
        System.out.println("FunctionInvoke.m3");
    }

    public int doubleNum(int numa){
        numa *= 2;
        return numa ;
    }
    public int ageDoubleNum(Student student){
        student.age *= 2;
        return  student.age ;
    }

    public static void main(String[] args) {
        new FunctionInvoke().m1();

        int numa = 10;
        System.out.println("numa before = " + numa);
        int result = new FunctionInvoke().doubleNum(numa);
        System.out.println("numa after= " + numa);
        System.out.println("result = " + result);

        Student student = new Student();
        student.age = 50;
        System.out.println("student.age before = " + student.age);
        int doubleAge = new FunctionInvoke().ageDoubleNum(student);
        System.out.println("student.age after = " + student.age);

        System.out.println("doubleAge = " + doubleAge);
    }
}


class Student{
    public int age;
}
